﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<%@ include file="/include/include.jsp" %>
<head>

	<script>

		function selectAddProduct(){
			if (!isSelected('idss')){
				alert("您必须选择一行!");
				return;
			}
			$('ids').value = getValuesByTagName('idss');
			$('form').action = "${ctx}/warehouse/addproduct/selectaddproduct";
			//alert($('form4').action);
			$('form').submit();
			//window.location ="${ctx}/warehouse/addproduct/selectaddproduct";
		}
	
	function validatorForm(){
	
		var result = Validator.Validate($('form1'),3)
		$('currPageId').value = document.getElementsByName('page.currentPage')[0].value;
		if(result)
			return confirm('您是否确认对 '+$('orderNumber').value+' 的订单进行补货吗？');
		else
			return false;
		
	}
	
</script>
</head>

<body>
	
	<%@ include file="/include/header.jsp" %>

	<%@ include file="/include/menu.jsp" %>
	<form id='form'  method="post">
		<input type="hidden" name="ids" id='ids' />
	</form>
			
	<div id="mainContent">
		<h2><a href="${ctx}/${menu.url}">${menu.description}</a>&nbsp;-&nbsp;<a href="${ctx}/${empty currViewBarSubMenu_ ? submenu.url : currViewBarSubMenu_.url}">${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}</a></h2>
		<!-- display="ROLE_SALES ROLE_ADMIN" -->
		<div class="tool-bar">
			<!-- <a href="${ctx}/house/housematerial/search" class="modal-window modal-link"  >添加${submenu.description}</a> -->
			<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 查询${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/warehouse/addproduct/list/search" class="modal-window modal-link">过滤查询</div>
			
			<a title="修改"    onclick="javascript:selectAddProduct();" >批量补货</a>
		</div>
		
		<div class="grid-list">
			<table class="grid" cellspacing="0">
				<thead>
					<tr>
						<td><input type="checkbox" name="aaa" onclick="clearAll(this,'idss')"/></td>
						<td>PO单号</td>
						<td>日期</td>
						<td>状态</td>
						<td>操作</td>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${inventoryRecords}" var="inventoryRecord">
						<tr>
							<td><c:if test="${inventoryRecord.addProduct == false}"><input type="checkbox" name="idss"  value="${inventoryRecord.id}"/></c:if></td>
							<td><a href="${ctx}/warehouse/addproductdetail/${inventoryRecord.purchaseOrder.id}/dosearch">${inventoryRecord.purchaseOrder.orderNumber}</a></td>
							<td><fmt:formatDate value="${inventoryRecord.operationDate}" pattern="yyyy-MM-dd"/></td>
							<td>${inventoryRecord.addProductFlagDisplayText}</td>
							<td>
							<c:if test="${inventoryRecord.addProduct == false}">
								<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 查看${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/warehouse/addproduct/view/addpurchare/${inventoryRecord.id}" class="modal-window modal-link">补货</div>
							</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<t:page action="${ctx}/warehouse/addproduct/list" />
		</div>
	</div>
	
	<%@ include file="/include/script.jsp" %>
	
</body>

</html> 